effect, and the curve of zedgraph's uncertain number of curves and column names can be adjusted.
Curve implementation code;Program code
Private void onrendergraph (zedgraphweb zgw, graphics g, masterpane){// Set chart attributesGraphpane mypane = masterpane [0];// Set the title and axis labelsMypane. Title. Text = "Total Inventory comparison curve ";Mypane. xaxis. Title. Text = "year-month-day ";Mypane. yaxis. Title. Text = "inventory ";Mypane. yaxis. Scale. minauto = true;Mypane. yaxis. Scal
Bar Chart display.
How can we dynamically display data? In winform, we can use timer controls or multithreading. Here we use timer controls.
Drag a tmier control from the toolbox to the form, set its enable to true, and add the following code to its timer1_tick event (note: generally, the database is read in real time as the bar chart data source ):
Double [] arrvalues = getarrvalues ();// Shift the text items up by 5 user scale units above the barsString [] xtitles = {"Wang xinxin", "jijie", "
display automaticallyMajorstep-> large scale step value.Majorstepauto-> automatically sets the step size of a large scale.Majorunit-> gets or sets the type of units used for the major step size (majorstep ).Makenewscale (scale, axistype)-> A construction method that creates a new scale object using the properties of an existing scale object, but specifying a new axistype.Max-> the maximum scale value displayed by default (a value greater than this value is displayed during scaling)
step size of a large scale.Majorunit-> gets or sets the type of units used for the major step size (majorstep ).Makenewscale (scale,Axistype)-> A construction method that creates a new scaleObject using the properties of an existing scale object, but specifyingNew axistype.Max-> the maximum scale value displayed by default (a value greater than this value is displayed during scaling)Maxauto-> automatically sets the maximum scale value.Maxgrace-> gets
make it dynamic, You need to regularly add coordinates to pointpairlist.
Add a timer control, set the interval attribute to 1000, and then add code to the tick event of Timer:
Zedgraphcontrol1.graphpane. xaxis. Scale. maxauto = true;
Double X = (double) New xdate (datetime. Now );
Double Y = ran. nextdouble ();
List. Add (x, y );
This. zedgraphcontrol1.axischange ();
This. zedgraphcontrol1.refresh ();
Run the command to see the line moving.
To displ
moving. To make it dynamic, You need to regularly add coordinates to pointpairlist.
Add a timer control, set the interval attribute to 1000, and then add code to the tick event of Timer:
Zedgraphcontrol1.graphpane. xaxis. Scale. maxauto = true;
Double X = (double) New xdate (datetime. Now );
Double Y = ran. nextdouble ();
List. Add (x, y );
This. zedgraphcontrol1.axischange ();
This. zedgraphcontrol1.refresh ();
Run the command to see
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.